package cn.cdut.yiwenqian.user.controller;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import cn.cdut.yiwenqian.biz.interfaces.IKnownleadeManager;
import cn.cdut.yiwenqian.entity.CdutPostUsers;

@Namespace(value="/pages")
@Controller
public class PageManagerAction extends ActionSupport{

	@Action(value="tofirstpage",results={@Result(name="success",location="/WEB-INF/jsp/main/firstpage.jsp")})
	public String toMainPage(){
		return "success";
	}
	@Action(value="userinfopage",results={@Result(name="success",location="/WEB-INF/jsp/main/userinfopage.jsp"),@Result(name="login",location="/WEB-INF/jsp/main/loginpage.jsp")})
	public String getUserInfoPage(){
		if(ActionContext.getContext().getSession().get("user")!=null){
			return "success";
		}else{
			return "login";
		}
	}
	@Action(value="toRegestPage",results={@Result(name="success",location="/WEB-INF/jsp/main/RegestPage.jsp")})
	public String toRegestPage(){
		return "success";
	}
	@Action(value="toUserSapcesPage", results={@Result(name="success",location="/WEB-INF/jsp/user/UserSpaces.jsp")})
	public String toUserSapcesPage(){
		return "success";
	}
	@Action(value="toUserInfoPage", results={@Result(name="success",location="/WEB-INF/jsp/user/UserInfo.jsp")})
	public String toUserInfoPage(){
		return "success";
	}
	@Action(value="toMyMessagePage", results={@Result(name="success",location="/WEB-INF/jsp/user/MyMessage.jsp")})
	public String toMyMessagePage(){
		return "success";
	}
	@Action(value="toMyPostPage", results={@Result(name="success",location="/WEB-INF/jsp/user/MyPost.jsp")})
	public String toMyPostPage(){
		return "success";
	}
	@Action(value="toMyNewsPage", results={@Result(name="success",location="/WEB-INF/jsp/user/MyNews.jsp")})
	public String toMyNewsPage(){
		return "success";
	}
	@Action(value="toMyKnowledagePage", results={@Result(name="success",location="/WEB-INF/jsp/user/MyKnowledage.jsp")})
	public String toMyKnowledagePage(){
		return "success";
	}
	@Action(value="toUpdateUserInfoPage", results={@Result(name="success",location="/WEB-INF/jsp/user/UpdateUserInfo.jsp")})
	public String toUpdateUserInfoPage(){
		return "success";
	}
	@Action(value="toCreatToolPage", results={@Result(name="success",location="/WEB-INF/jsp/tool/CreateToolPage.jsp")})
	public String toCreatToolPage(){
		return "success";
	}
	@Action(value="toCreatNewsPage", results={@Result(name="success",location="/WEB-INF/jsp/news/CreateNewsPage.jsp")})
	public String toCreatNewsPage(){
		return "success";
	}
	@Action(value="toCreatPostType", results={@Result(name="success",location="/WEB-INF/jsp/post/CreateTitleTypePage.jsp")})
	public String toCreatPostType(){
		return "success";
	}
	
}
